3.26 \(\int \frac{(3-x+2 x^2)^2}{2+3 x+5 x^2} \, dx\)

Optimal. Leaf size=56 \[ \frac{4 x^3}{15}-\frac{16 x^2}{25}-\frac{1573 \log \left (5 x^2+3 x+2\right )}{1250}+\frac{381 x}{125}+\frac{8349 \tan ^{-1}\left (\frac{10 x+3}{\sqrt{31}}\right )}{625 \sqrt{31}} \]

[Out]

(381*x)/125 - (16*x^2)/25 + (4*x^3)/15 + (8349*ArcTan[(3 + 10*x)/Sqrt[31]])/(625*Sqrt[31]) - (1573*Log[2 + 3*x
 + 5*x^2])/1250

________________________________________________________________________________________

Rubi [A]  time = 0.0513899, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {1657, 634, 618, 204, 628} \[ \frac{4 x^3}{15}-\frac{16 x^2}{25}-\frac{1573 \log \left (5 x^2+3 x+2\right )}{1250}+\frac{381 x}{125}+\frac{8349 \tan ^{-1}\left (\frac{10 x+3}{\sqrt{31}}\right )}{625 \sqrt{31}} \]

Antiderivative was successfully verified.

[In]

Int[(3 - x + 2*x^2)^2/(2 + 3*x + 5*x^2),x]

[Out]

(381*x)/125 - (16*x^2)/25 + (4*x^3)/15 + (8349*ArcTan[(3 + 10*x)/Sqrt[31]])/(625*Sqrt[31]) - (1573*Log[2 + 3*x
 + 5*x^2])/1250

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{\left (3-x+2 x^2\right )^2}{2+3 x+5 x^2} \, dx &=\int \left (\frac{381}{125}-\frac{32 x}{25}+\frac{4 x^2}{5}+\frac{121 (3-13 x)}{125 \left (2+3 x+5 x^2\right )}\right ) \, dx\\ &=\frac{381 x}{125}-\frac{16 x^2}{25}+\frac{4 x^3}{15}+\frac{121}{125} \int \frac{3-13 x}{2+3 x+5 x^2} \, dx\\ &=\frac{381 x}{125}-\frac{16 x^2}{25}+\frac{4 x^3}{15}-\frac{1573 \int \frac{3+10 x}{2+3 x+5 x^2} \, dx}{1250}+\frac{8349 \int \frac{1}{2+3 x+5 x^2} \, dx}{1250}\\ &=\frac{381 x}{125}-\frac{16 x^2}{25}+\frac{4 x^3}{15}-\frac{1573 \log \left (2+3 x+5 x^2\right )}{1250}-\frac{8349}{625} \operatorname{Subst}\left (\int \frac{1}{-31-x^2} \, dx,x,3+10 x\right )\\ &=\frac{381 x}{125}-\frac{16 x^2}{25}+\frac{4 x^3}{15}+\frac{8349 \tan ^{-1}\left (\frac{3+10 x}{\sqrt{31}}\right )}{625 \sqrt{31}}-\frac{1573 \log \left (2+3 x+5 x^2\right )}{1250}\\ \end{align*}

Mathematica [A]  time = 0.01929, size = 53, normalized size = 0.95 \[ \frac{10 x \left (100 x^2-240 x+1143\right )-4719 \log \left (5 x^2+3 x+2\right )}{3750}+\frac{8349 \tan ^{-1}\left (\frac{10 x+3}{\sqrt{31}}\right )}{625 \sqrt{31}} \]

Antiderivative was successfully verified.

[In]

Integrate[(3 - x + 2*x^2)^2/(2 + 3*x + 5*x^2),x]

[Out]

(8349*ArcTan[(3 + 10*x)/Sqrt[31]])/(625*Sqrt[31]) + (10*x*(1143 - 240*x + 100*x^2) - 4719*Log[2 + 3*x + 5*x^2]
)/3750

________________________________________________________________________________________

Maple [A]  time = 0.044, size = 44, normalized size = 0.8 \begin{align*}{\frac{381\,x}{125}}-{\frac{16\,{x}^{2}}{25}}+{\frac{4\,{x}^{3}}{15}}-{\frac{1573\,\ln \left ( 5\,{x}^{2}+3\,x+2 \right ) }{1250}}+{\frac{8349\,\sqrt{31}}{19375}\arctan \left ({\frac{ \left ( 3+10\,x \right ) \sqrt{31}}{31}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x^2-x+3)^2/(5*x^2+3*x+2),x)

[Out]

381/125*x-16/25*x^2+4/15*x^3-1573/1250*ln(5*x^2+3*x+2)+8349/19375*arctan(1/31*(3+10*x)*31^(1/2))*31^(1/2)

________________________________________________________________________________________

Maxima [A]  time = 1.48807, size = 58, normalized size = 1.04 \begin{align*} \frac{4}{15} \, x^{3} - \frac{16}{25} \, x^{2} + \frac{8349}{19375} \, \sqrt{31} \arctan \left (\frac{1}{31} \, \sqrt{31}{\left (10 \, x + 3\right )}\right ) + \frac{381}{125} \, x - \frac{1573}{1250} \, \log \left (5 \, x^{2} + 3 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*x^2-x+3)^2/(5*x^2+3*x+2),x, algorithm="maxima")

[Out]

4/15*x^3 - 16/25*x^2 + 8349/19375*sqrt(31)*arctan(1/31*sqrt(31)*(10*x + 3)) + 381/125*x - 1573/1250*log(5*x^2
+ 3*x + 2)

________________________________________________________________________________________

Fricas [A]  time = 0.993161, size = 165, normalized size = 2.95 \begin{align*} \frac{4}{15} \, x^{3} - \frac{16}{25} \, x^{2} + \frac{8349}{19375} \, \sqrt{31} \arctan \left (\frac{1}{31} \, \sqrt{31}{\left (10 \, x + 3\right )}\right ) + \frac{381}{125} \, x - \frac{1573}{1250} \, \log \left (5 \, x^{2} + 3 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*x^2-x+3)^2/(5*x^2+3*x+2),x, algorithm="fricas")

[Out]

4/15*x^3 - 16/25*x^2 + 8349/19375*sqrt(31)*arctan(1/31*sqrt(31)*(10*x + 3)) + 381/125*x - 1573/1250*log(5*x^2
+ 3*x + 2)

________________________________________________________________________________________

Sympy [A]  time = 0.188934, size = 63, normalized size = 1.12 \begin{align*} \frac{4 x^{3}}{15} - \frac{16 x^{2}}{25} + \frac{381 x}{125} - \frac{1573 \log{\left (x^{2} + \frac{3 x}{5} + \frac{2}{5} \right )}}{1250} + \frac{8349 \sqrt{31} \operatorname{atan}{\left (\frac{10 \sqrt{31} x}{31} + \frac{3 \sqrt{31}}{31} \right )}}{19375} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*x**2-x+3)**2/(5*x**2+3*x+2),x)

[Out]

4*x**3/15 - 16*x**2/25 + 381*x/125 - 1573*log(x**2 + 3*x/5 + 2/5)/1250 + 8349*sqrt(31)*atan(10*sqrt(31)*x/31 +
 3*sqrt(31)/31)/19375

________________________________________________________________________________________

Giac [A]  time = 1.16036, size = 58, normalized size = 1.04 \begin{align*} \frac{4}{15} \, x^{3} - \frac{16}{25} \, x^{2} + \frac{8349}{19375} \, \sqrt{31} \arctan \left (\frac{1}{31} \, \sqrt{31}{\left (10 \, x + 3\right )}\right ) + \frac{381}{125} \, x - \frac{1573}{1250} \, \log \left (5 \, x^{2} + 3 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*x^2-x+3)^2/(5*x^2+3*x+2),x, algorithm="giac")

[Out]

4/15*x^3 - 16/25*x^2 + 8349/19375*sqrt(31)*arctan(1/31*sqrt(31)*(10*x + 3)) + 381/125*x - 1573/1250*log(5*x^2
+ 3*x + 2)